home *** CD-ROM | disk | FTP | other *** search
/ Reverse Code Engineering RCE CD +sandman 2000 / ReverseCodeEngineeringRceCdsandman2000.iso / RCE / Library / Manuels & Misc / Assembly / AOA.ZIP / CH06 / EX6_3.IBM < prev    next >
Encoding:
Text File  |  1996-02-04  |  888 b   |  45 lines

  1. #data
  2.  
  3. ; The following code sequence tests checks the amount of time required
  4. ; to load word variables from even and odd addresses.
  5. ;
  6. ; Note that this code assumes that IBM/L inserts all user variables
  7. ; at the beginning of the data segment.  If you modify the sources
  8. ; to IBMLINC.A and insert stuff before the marker, this code may
  9. ; not work properly.
  10. ;
  11. ; The three bytes between I and J make sure that J's address is at
  12. ; an address where (adrs mod 4) = 3 to guarantee slow performance
  13. ; on a 386/486.
  14.  
  15. I        dw    ?    ;Variable at even address
  16.         db    0
  17. J        dw    ?    ;Variable at odd address.
  18.  
  19. #enddata
  20.  
  21. #repetitions 1000000
  22. #unravel 128
  23.  
  24. #code ("MOV AX, EVENADRS")
  25. %do
  26.         mov    ax, i
  27. #endcode
  28.  
  29. #code ("MOV AX, ODDADRS")
  30. %do
  31.         mov    ax, j
  32. #endcode
  33.  
  34. #code ("MOV BX, EVENADRS")
  35. %do
  36.         mov    bx, i
  37. #endcode
  38.  
  39. #code ("MOV BX, ODDADRS")
  40. %do
  41.         mov    bx, j
  42. #endcode
  43.  
  44. #end
  45.